#include <iostream>
#include<vector>
using namespace std;

int main()
{
    int n = 0;
    cin >> n;
    vector<vector<int>> vv;
    vv.resize(n);
    for(int i = 0; i < n; i++)
    {
        vector<int> v;
        v.resize(i + 1, 0);
        v[0] = v[i] = 1;
        vv[i] = v;
        for (int j = 1; j < i; j++)
        {
            vv[i][j] = vv[i - 1][j] + vv[i - 1][j - 1];
        }
        
    }
    for (auto e : vv)
    {
        for (auto num : e)
        {
            printf("%5d", num);
        }
        cout << endl;
    }
    return 0;
}
